Skip to content

rf: Use ondiagnostics tools to fetch data#3

Merged
effigies merged 21 commits into
mainfrom
rf/ondiagnostics-refactor
Mar 20, 2026
Merged

rf: Use ondiagnostics tools to fetch data#3
effigies merged 21 commits into
mainfrom
rf/ondiagnostics-refactor

Conversation

@effigies
Copy link
Copy Markdown
Contributor

This PR:

  • Converts scripts to a CLI with subcommands
  • Removes reimplementations of code on ondiagnostics

Some inconsistencies remain, e.g., we still use print() statements where ondiagnostics uses structlog, so the output's a little wonky. Not a major concern here, though.

effigies added 21 commits March 19, 2026 12:24
Create the openneuro-dashboard package under code/ with:
- pyproject.toml declaring ondiagnostics as an editable dependency
- Typer CLI skeleton with all 7 subcommands (stubs)
- Test directory structure (unit, integration, fixtures)
- Shared test fixtures (conftest.py) for GraphQL, git, and S3 mocking
SCHEMA_VERSION, format_timestamp, write_json, load_json, load_json_safe
Replace local GraphQL types with ondiagnostics.graphql imports.
Use get_page(include_snapshots=True) from ondiagnostics.
Replace local SubprocessResult/git with ondiagnostics.tasks.git.list_refs.
Dashboard-specific DOI parsing and version extraction.
Replace local git() with ondiagnostics.subprocs.git.
Keep local S3 listing for unsigned access.
Dashboard-specific status aggregation and precedence logic.
Connect fetch-graphql, check-github, check-s3-version, check-s3-files,
and summarize to their migrated modules. Implement run-all to execute
all stages in sequence.
Tests for DOI parsing, status aggregation, diff computation,
and shared utilities. 28 tests passing.
Pin ondiagnostics>=0.1.0, document which ondiagnostics modules are
used and what dashboard-specific logic remains.
Migrate graphql, github, s3_version, git_tree, and s3_diff generators
into the openneuro_dashboard.gen_data package.
Orchestrate all generators: graphql → github → s3_version →
git_tree → s3_diff → summarize.
5 datasets covering healthy, blocked, version-mismatch, warning,
and export-missing states. Integration test verifies summarize
stage produces correct aggregated statuses.
All pipeline stages and gen_data generators have been migrated
to the openneuro_dashboard package under code/.
Replace individual script invocations with openneuro-dashboard
run-all command. Bump Python to 3.14.
Document CLI usage, development setup, and test running.
get_page() calls execute_async() which is a Client method, not
an AsyncClientSession method. Remove the async-with wrapper.
@effigies effigies merged commit 78484cf into main Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant